import axios from 'axios';
import service from '../request/';
import { da } from 'element-plus/es/locales.mjs';

const controller = "Dict"

/**
* 
分页
* @param {*} data 
* @returns 
*/
function query(data: any) {
    return service({
        method: 'get',
        url: controller + '/query',
        params: data,
    })
}
/*
修改
*/
function put(data: any) {
    return service({
        method: 'post',
        url: controller + '/Update',
        data: data,
    })
}
/**
* 查找单个
* @param {*} data 
* @returns 
*/
function get(data: any) {
    return service({
        method: 'get',
        url: controller,
        params: data,

    })
}

/**
* 删除
* @param {*} data 
* @returns 
*/
function del(data: any) {
    return service({
        method: 'delete',
        url: controller,
        params: data,
    })
}

/*
添加
*/
function Add(data: any) {
    return service({
        method: 'post',
        url: controller + '/Add',
        data: data,
    })
}

/**
 * 根据分类查询
 * @param {any} data 
 * @return 
*/
function dicttype(data: any) {
    return service({
        method: 'get',
        url: controller + "/type",
        params: data,

    })
}

function getStatus(data:any){
    return service({
        method:'get',
        url:controller+'/gettype',
        params:data
    })

}

export default {
    del,
    get,
    put,
    query,
    Add,
    dicttype,
    getStatus
}